package com.hns.can.energy.service;

import com.hns.can.common.aop.orgTree.LeftOrgAnnotation;
import com.hns.can.common.formula.FillCodeDscValue;
import com.hns.can.energy.entity.EaiIttriplogEntity;
import com.hns.can.energy.vo.ParamVo;
import com.hns.can.master.entity.CommEnerConsStatInfoEntity;
import com.hns.frame.mybatis.Pagination;
import com.hns.frame.service.CommonService;
import com.hns.tool.pub.PubUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 能耗明细数据service
 * @author:Fisher
 * @email:zhuangcaijin@126.com
 * @version Revision 2.0.0
 */
@Service
public class EnergyDetailService extends CommonService {
    
    @Autowired
    private FillCodeDscValue codeDscValue;

    /**
     *  查询
     * @param conditionVo
     * @return
     * @throws Exception
     */
    @LeftOrgAnnotation()
    @Transactional
    public Pagination searchEnergyDetail(ParamVo paramVo) throws Exception {
             Pagination page = this.myBatisPage("energyDetail.searchEnergyDetailCnt", "energyDetail.searchEnergyDetailData", paramVo,CommEnerConsStatInfoEntity.class);
        return page;
    }

    /**
     * 导出
     * @param conditionVo
     * @return
     * @throws Exception
     */
    @LeftOrgAnnotation()
    @Transactional
    public List<CommEnerConsStatInfoEntity> exportEnergyDetail(ParamVo vo) throws Exception {
        List list = PubUtil.convertListMapToObject(sqlMapDao.selectList("energyDetail.searchEnergyDetailData", vo), CommEnerConsStatInfoEntity.class);
        return list;
    }
}
